﻿<template>
  <div>
    <h1>Inject 爷爷组件</h1>
    <InjectParentComponent />
  </div>
</template>

<script>
import { computed } from 'vue';
import InjectParentComponent from './Components/InjectParentComponent.vue';

export default {
  components: {
    InjectParentComponent
  },
  data() {
    return {
      message: '来自爷爷的问候！',
      userInfo: {
        name: 'Grandpa'
      }
    };
  },
  provide() {
    return {
      message: this.message,
      userInfo: this.userInfo
    };
  }
}
</script>
